using Microsoft.AspNetCore.Builder;

namespace ELportal.Common.Extensions;

public static class CorsExtension
{
	public static IApplicationBuilder UseCorsAllowAnyOrigin(this IApplicationBuilder appBuilder)
	{
		return appBuilder.UseCors(builder => builder
			.AllowAnyMethod()
			.AllowAnyHeader()
			.SetIsOriginAllowed(_ => true)
			.AllowCredentials());
	}
}
